<html>
<head><meta charset="utf-8"><title>De Morgan&#x27;s Law with multiple terms · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html">De Morgan&#x27;s Law with multiple terms</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228875334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228875334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228875334">(Mar 05 2021 at 00:23)</a>:</h4>
<p>If I have <code>(b != 0x09 &amp;&amp; b != 0x0A &amp;&amp; b != 0x0D)</code>, should I be able to change that into <code>!(b == 0x09 || b == 0x0A || b == 0x0D)</code> ? I'm just getting it to apply to two of the terms.</p>



<a name="228912627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228912627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228912627">(Mar 05 2021 at 08:16)</a>:</h4>
<p>Yes. I think clippy will yell at you for this pattern though, and suggest something like <code>![0x09, 0x0A, 0x0D].contains(&amp;b)</code>, or I guess <code>!b"\t\r\n".contains(&amp;b)</code> if I remember my ascii. (EDIT: misread the context, this is off-topic)</p>



<a name="228917398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228917398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228917398">(Mar 05 2021 at 08:52)</a>:</h4>
<p>the assist currently only applies it for the two terms that are part of the operator your cursor is on</p>



<a name="228918482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228918482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228918482">(Mar 05 2021 at 08:54)</a>:</h4>
<p>You absolutely should, if you can not, that's a bug in <a href="https://github.com/matklad/rust-analyzer/blob/142f9a03fd4bad366439b18d8de7f2237bed65ab/crates/ide_assists/src/handlers/apply_demorgan.rs#L1">https://github.com/matklad/rust-analyzer/blob/142f9a03fd4bad366439b18d8de7f2237bed65ab/crates/ide_assists/src/handlers/apply_demorgan.rs#L1</a></p>



<a name="228958967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228958967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228958967">(Mar 05 2021 at 14:08)</a>:</h4>
<p>My experience mirror's <span class="user-mention" data-user-id="300586">@Lukas Wirth</span>'s — it only applies to the two terms around the one operator. I <em>am</em> using this via emacs, so I'd appreciate it if someone with Visual Studio could confirm if it affects them as well. If it does, I'll file an issue.</p>



<a name="228959259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228959259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228959259">(Mar 05 2021 at 14:10)</a>:</h4>
<p>that should be independent of Emacs</p>



<a name="228959329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228959329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228959329">(Mar 05 2021 at 14:11)</a>:</h4>
<p>we just need to handle that extra case, shouldn't be too hard. Perhaps you want to file a PR ^^ ?</p>



<a name="228965730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228965730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228965730">(Mar 05 2021 at 14:52)</a>:</h4>
<p>I assume that <code>a &amp;&amp; b &amp;&amp; c</code> is <code>(Binary (Binary a b) c)</code> (or similar nesting); is there something that will easily look up  and down the tree to get all of the terms at the same semantic level?</p>



<a name="228965898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228965898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228965898">(Mar 05 2021 at 14:53)</a>:</h4>
<p>RA offers a command <code>Show Syntax Tree</code> but I think that is only supported in vscode</p>



<a name="228966028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228966028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228966028">(Mar 05 2021 at 14:54)</a>:</h4>
<p>The tree for that is</p>
<div class="codehilite"><pre><span></span><code>            BIN_EXPR@7219..7230
              BIN_EXPR@7219..7225
                PATH_EXPR@7219..7220
                  PATH@7219..7220
                    PATH_SEGMENT@7219..7220
                      NAME_REF@7219..7220
                        IDENT@7219..7220 &quot;a&quot;
                WHITESPACE@7220..7221 &quot; &quot;
                AMP2@7221..7223 &quot;&amp;&amp;&quot;
                WHITESPACE@7223..7224 &quot; &quot;
                PATH_EXPR@7224..7225
                  PATH@7224..7225
                    PATH_SEGMENT@7224..7225
                      NAME_REF@7224..7225
                        IDENT@7224..7225 &quot;b&quot;
              WHITESPACE@7225..7226 &quot; &quot;
              AMP2@7226..7228 &quot;&amp;&amp;&quot;
              WHITESPACE@7228..7229 &quot; &quot;
              PATH_EXPR@7229..7230
                PATH@7229..7230
                  PATH_SEGMENT@7229..7230
                    NAME_REF@7229..7230
                      IDENT@7229..7230 &quot;c&quot;
</code></pre></div>



<a name="228966108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228966108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228966108">(Mar 05 2021 at 14:54)</a>:</h4>
<p>so ye its <code>((a &amp;&amp; b) &amp;&amp; c)</code> nesting-wise</p>



<a name="228966184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228966184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228966184">(Mar 05 2021 at 14:55)</a>:</h4>
<p>you can walk the tree for next and prev let me check quickly how that goes</p>



<a name="228966520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228966520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228966520">(Mar 05 2021 at 14:57)</a>:</h4>
<p>Ah wait up and down, you can go up with <code>ancestors</code> and down with <code>children</code> if you mean that</p>



<a name="228966708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228966708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228966708">(Mar 05 2021 at 14:58)</a>:</h4>
<p>you have to invoke those on <code>SyntaxNode</code>s, so if you got an expression you'd be able to go up/down by doing <code>expr.syntax().ancestors()</code></p>



<a name="228967141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228967141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228967141">(Mar 05 2021 at 15:00)</a>:</h4>
<p>it starts with <code>let expr = ctx.find_node_at_offset::&lt;ast::BinExpr&gt;()?;</code>.</p>
<p>I'm thinking  I basically need to see if either lhs or rhs is another binexpr with the same operator, or if I'm part of a binexpr with the same operator. That's what I mean by "up"/"down".</p>



<a name="228968006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228968006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228968006">(Mar 05 2021 at 15:05)</a>:</h4>
<p>Ah right, going down should be simple since you can directly insepect the sub expressions <a href="https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/syntax/src/ast/expr_ext.rs#L171-L232">https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/syntax/src/ast/expr_ext.rs#L171-L232</a>. <br>
But going up seems a bit more tricky I suppose, let me think for a sec</p>



<a name="228968244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228968244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228968244">(Mar 05 2021 at 15:06)</a>:</h4>
<p><code>expr.parent().and_then(ast::BinExpr::cast)</code></p>



<a name="228968297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228968297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228968297">(Mar 05 2021 at 15:07)</a>:</h4>
<p>right, its actually rather simple I confused myself there <span aria-label="big smile" class="emoji emoji-1f604" role="img" title="big smile">:big_smile:</span></p>



<a name="228968517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228968517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228968517">(Mar 05 2021 at 15:08)</a>:</h4>
<p>Though you have to put a <code>syntax</code> call in between, <code>expr.syntax().parent()</code></p>



<a name="228969934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228969934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228969934">(Mar 05 2021 at 15:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="300586">Lukas Wirth</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/De.20Morgan's.20Law.20with.20multiple.20terms/near/228965898">said</a>:</p>
<blockquote>
<p>RA offers a command <code>Show Syntax Tree</code> but I think that is only supported in vscode</p>
</blockquote>
<p>it's supported in Emacs: <code>lsp-rust-analyzer-syntax-tree</code></p>



<a name="228972767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228972767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228972767">(Mar 05 2021 at 15:34)</a>:</h4>
<p>What determines if code goes outside the call to <code>Assists::add</code> or inside? E.g. this code computes <code>lhs</code> and <code>not_lhs</code> outside. Just to make use of <code>?</code>?</p>



<a name="228972835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228972835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228972835">(Mar 05 2021 at 15:34)</a>:</h4>
<p>Yup</p>



<a name="228972868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228972868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228972868">(Mar 05 2021 at 15:35)</a>:</h4>
<p>the code outside can return <code>None</code> (meaning the assist doesn't apply)</p>



<a name="228972917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228972917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228972917">(Mar 05 2021 at 15:35)</a>:</h4>
<p>the code insided should not fail and  should compute the actual edit</p>



<a name="228972989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228972989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228972989">(Mar 05 2021 at 15:35)</a>:</h4>
<p>(see <a href="https://rust-analyzer.github.io/blog/2020/09/28/how-to-make-a-light-bulb.html">https://rust-analyzer.github.io/blog/2020/09/28/how-to-make-a-light-bulb.html</a> for somewhat amusing explanation of the shape of this api<br>
)</p>



<a name="228973294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228973294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228973294">(Mar 05 2021 at 15:37)</a>:</h4>
<p>and presumably <code>lhs</code> can be <code>None</code> if we have malformed input?</p>



<a name="228973425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228973425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228973425">(Mar 05 2021 at 15:38)</a>:</h4>
<p>Yes</p>



<a name="228977402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228977402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228977402">(Mar 05 2021 at 16:04)</a>:</h4>
<p>Just going to repeat this every so often:</p>
<blockquote>
<p>shouldn't be too hard</p>
</blockquote>



<a name="228978385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228978385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228978385">(Mar 05 2021 at 16:10)</a>:</h4>
<p>You just need to invest enough time to makes sure that sunk cost fallacy prevents you from bailing out :)</p>



<a name="228999562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/228999562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Mcguigan <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#228999562">(Mar 05 2021 at 18:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="129457">Florian Diebold</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/De.20Morgan's.20Law.20with.20multiple.20terms/near/228969934">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="300586">Lukas Wirth</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/De.20Morgan's.20Law.20with.20multiple.20terms/near/228965898">said</a>:</p>
<blockquote>
<p>RA offers a command <code>Show Syntax Tree</code> but I think that is only supported in vscode</p>
</blockquote>
<p>it's supported in Emacs: <code>lsp-rust-analyzer-syntax-tree</code></p>
</blockquote>
<p>also in <code>coc.vim</code> with <code>:CocCommand rust-analyzer.syntaxTree</code></p>



<a name="229026276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/229026276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#229026276">(Mar 05 2021 at 21:16)</a>:</h4>
<p>I have something quite ugly but passing tests — open a PR, draft PR, just drop a link here, other?</p>



<a name="229026884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/229026884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#229026884">(Mar 05 2021 at 21:21)</a>:</h4>
<p>My guess is that someone more familiar with navigating the trees will say "oh, use &lt;this function&gt; to clean up that cruft".</p>



<a name="229026985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/229026985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#229026985">(Mar 05 2021 at 21:22)</a>:</h4>
<p><a href="https://github.com/shepmaster/rust-analyzer/tree/multiple-demorgan">https://github.com/shepmaster/rust-analyzer/tree/multiple-demorgan</a> to start with.</p>



<a name="229090224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/De%20Morgan%27s%20Law%20with%20multiple%20terms/near/229090224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/De.20Morgan&#x27;s.20Law.20with.20multiple.20terms.html#229090224">(Mar 06 2021 at 11:26)</a>:</h4>
<p>Seems good to me</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>